package me.wangcai.trafficpoliceai.enums;


import lombok.Getter;

@Getter
public enum PermissionEnum{
    USER(0,"普通用户"),
    ADMIN(1,"管理员"),
    SUPER_ADMIN(2,"超级管理员");


    private String name;
    private int index;

    PermissionEnum(int index, String name) {
        this.index = index;
        this.name = name;
    }

    public static PermissionEnum indexOf(int index){
        for (PermissionEnum value : PermissionEnum.values()) {
            if(index == value.index) return value;
        }
        return null;
    }

}
